package com.htl.io.字符流;

import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

/**
 *  输出字符流 Writer
 */

public class Writer__test {
    public static void main(String[] args) {
        Writer writer = null;
        try {
            writer = new FileWriter("D:\\Project\\IDEA_project\\java_note\\src\\com\\htl\\io\\writer.txt");

            // 写
            writer.write(20320);
            writer.write(22909);

            char[] chars = {'，','好','好','学','习'};
            writer.write(chars);
//            writer.write(chars,3,2);

            String str = "，天天向上";
            writer.write(str);
//            writer.write(str,3,2);

            writer.flush();


        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                // 关闭数据流
                writer.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }
}
